/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pvtracejava;

import java.io.*;
import java.util.Stack;

/**
 *
 * @author Administrator
 */
public class PvtraceJava {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws FileNotFoundException, IOException {

        Stack<String> popm = new Stack<String>();
        if (args.length != 1) {
            System.exit(0);
        }
        SymbolMonitor monitor = new SymbolMonitor(args[0]);
        File infile = new File("trace.txt");
        if (infile.exists()) {
            BufferedReader fr = new BufferedReader(new FileReader(infile));
            String line;
            try {
                
                while ((line = fr.readLine()) != null) {
                    try {
                        monitor.SymBol(line);
                    } catch (Exception e) {
                    }
                       
                     
           }
                monitor.emitSymbols();
            } catch (Exception e) {
            }
        } else {
            System.out.println("Cannot  found trace.txt file in:" + System.getProperty("user.dir"));
        }

    }
}
